package models

import (
	"github.com/astaxie/beego/orm"
	_ "github.com/go-sql-driver/mysql"
)

type User struct {
	Id    int
	Name  string
	Pwd   string
	Role  string
	Level string
	ImgId string
}
type Article struct {
	Id      int
	Uid     int
	Title   string
	Content string
	Path    string
	Deploy  bool
}
type Image struct {
	Id   int
	Uid  int
	Name string
	Path string
}

//id 表示Book 的页码
type Book struct {
	Id       int
	Uid      int
	HomePage string
	Title    string
	Content  string
	ImgId    string
	Deploy   string
}

//video database set
type Video struct {
	Id     int
	Uid    int
	Name   string
	Path   string
	Poster string
	Type   string
}

func init() {
	orm.RegisterDataBase("default", "mysql", "yuanshanshan:150318yss@tcp(47.104.96.13:3306)/test?charset=utf8")
	orm.RegisterModel(new(User), new(Article), new(Image), new(Book), new(Video))
	orm.RunSyncdb("default", false, true)
}
